#ifndef CSOUNDCLASS_H
#define CSOUNDCLASS_H

class CSoundClass
{
	struct WaveHeaderType
	{
		char cChunkID[4];
		unsigned long ulChunkSize;
		char cFormat[4];
		char cSubChunkID[4];
		unsigned long ulSubChunkSize;
		unsigned short usAudioFormat;
		unsigned short usNumChannels;
		unsigned long ulSampleRate;
		unsigned long ulBytesPerSecond;
		unsigned short usBlockAlign;
		unsigned short usBitsPerSample;
		char cDataChunkID[4];
		unsigned long ulDataSize;
	};

	IDirectSound8* m_pDirectSound;
	IDirectSoundBuffer* m_pPrimaryBuffer;
	IDirectSoundBuffer8* m_pSecondaryBuffer;

	bool InitializeDirectSound(HWND hWnd);
	void ShutDownDirectSound();
	bool LoadWaveFile(char* cFileName, IDirectSoundBuffer8** pSecondaryBuffer);
	void ShutDownWaveFile(IDirectSoundBuffer8** pSecondaryBuffer);
	bool PlayWaveFile();

public:
	CSoundClass(void);
	CSoundClass(const CSoundClass&);
	~CSoundClass(void);

	bool Initialize(HWND hWnd);
	void ShutDown();
};

#endif